# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=unicode-character-database
pkgver=16.0.0
pkgrel=0
pkgdesc="Unicode Character Database"
arch="noarch"
license="Unicode-DFS-2015"
url="https://www.unicode.org/"
makedepends="libarchive-tools"
source="UCD-$pkgver.zip::https://www.unicode.org/Public/zipped/$pkgver/UCD.zip
	Unihan-$pkgver.zip::https://www.unicode.org/Public/zipped/$pkgver/Unihan.zip
	emoji-sequences-${pkgver%.*}.txt::https://www.unicode.org/Public/emoji/${pkgver%.*}/emoji-sequences.txt
	emoji-zwj-sequences-${pkgver%.*}.txt::https://www.unicode.org/Public/emoji/${pkgver%.*}/emoji-zwj-sequences.txt
	emoji-test-${pkgver%.*}.txt::https://www.unicode.org/Public/emoji/${pkgver%.*}/emoji-test.txt
	"
options="!check" # no tests to speak off
replaces="unicode-emoji"
builddir="$srcdir"

package() {
	for _f in UCD Unihan; do
		install -Dm644 $_f-$pkgver.zip "$pkgdir/usr/share/unicode/$_f.zip"
		bsdtar -C "$pkgdir/usr/share/unicode" -x --no-same-owner --no-same-permissions -f $_f-$pkgver.zip
	done

	for _f in sequences test zwj-sequences; do
		install -Dm644 emoji-$_f-${pkgver%.*}.txt "$pkgdir"/usr/share/unicode/emoji/emoji-$_f.txt
	done
}

sha512sums="
0fde45accf7068d639dcf8e739c7d9595c4cb3917f2e440cd0683aec1c0eebf5f4d0a975be09e5bc6297048a7031e84b5fcd4018ab29cc275801d770628b4439  UCD-16.0.0.zip
90e42cfcf442c13f29e5925aa09efa310cbbe8a691b760ca455d24f42a75ec4c04240bb9a4e0ecdfddae28b50ab0c8b0b2ec6d112f0c5fa5ba4de92f58784346  Unihan-16.0.0.zip
916b652cda652475443f4b8946be6a6996b82b1868ba0276bbfdfb2df246ad0c2da89370083c7e2bffc0624f156dc5ce7283d9aee2380ccc88ddd224323104b5  emoji-sequences-16.0.txt
9f1f952736cea552217c81264a857b0c2d328dccbe2b110ede7e3a006c6a30f25293e2f16f185616c72db48507b1a14fcbfdeaa277df2a6ab2f89b07aa2ccfa5  emoji-zwj-sequences-16.0.txt
f755d40a35a005bad13bdd4a1a9ea801724c488cb4f56d7fdb8b33b35cd7c6527d14f208ef4b4d545343a62a12baeed480cad18995ebb12e37112f072184435d  emoji-test-16.0.txt
"
